package com.school.movie.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.school.movie.business.web.model.pojo.MovieVideo;
import com.school.movie.business.web.model.vo.VideoVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (MovieVideo)表数据库访问层
 *
 * @author makejava
 * @since 2021-01-27 20:14:32
 */
public interface MovieVideoMapper extends BaseMapper<MovieVideo> {

    /**
     * 返回分页视频数据
     * @return
     */
    @Select("select mv.*,m.managerName as userName,m1.movieName from movie_video mv inner join manager m on mv.uid=m.managerId inner join " +
            "movie m1 on m1.movieId=mv.movieId")
    List<MovieVideo> listByPage();

    /**
     * 查询移动端视频数据
     *
     * @return
     */
    @Select("select mv.*,m.managerName  as userName, m.headimg, m1.movieName,m1.cimg,m1.hopeLook from movie_video mv inner join manager m on mv.uid=m.managerId inner join " +
            "movie m1 on m1.movieId=mv.movieId")
    List<VideoVo> listUserVideoByPage();
}